home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
dax1.exe
/
CLIENT
/
INOUT
/
DOS
/
INOUT.C
next >
Wrap
Text File
|
1992-07-15
|
4KB
|
96 lines
// ╔════════════════════════════════════════════════════════════════════╗
// ║ ║
// ║ module: inout.c ║
// ║ abstract: This module logs in and out of the DAX Engine. ║
// ║ ║
// ║ environment: NetWare 3.x v3.11 ║
// ║ Network C for DOS v2.0 ║
// ║ NetWare C Interface DOS v1.2 ║
// ║ ║
// ║ This software is provided as is and carries no warranty ║
// ║ whatsoever. Novell disclaims and excludes any and all implied ║
// ║ warranties of merchantability, title and fitness for a particular ║
// ║ purpose. Novell does not warrant that the software will satisfy ║
// ║ your requirements or that the software is without defect or error ║
// ║ or that operation of the software will be uninterrupted. You are ║
// ║ using the software at your risk. The software is not a product ║
// ║ of Novell, Inc. or any of subsidiaries. ║
// ║ ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ maintenance history: ║
// ║ level date pi description ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ 001 03/05/92 kl initial release. ║
// ╚════════════════════════════════════════════════════════════════════╝
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include "h/appl.h"
#include "dap/dapapi.h"
#include <nxt.h>
static DAPDATA *dd;
atexitproc()
{
if( dd ){
DAPDeAllocateSession(dd);
DAPDeInitialize(dd);
}
}
errorexit(int rc, char *msg)
{
printf("\n\n\t%s. rc = %d\n\tERROR: %s\n",
msg,
rc,
DAPTranslateReturnCode(rc));
DAPDisplaySessionData(dd);
exit(1);
}
#define DEFOUTER 1000
#define DEFINNER 10
main(int argc, char *argv[])
{
int rc,x,y;
LONG iter=0L;
LONG outerlimit = DEFOUTER;
LONG innerlimit = DEFINNER;
if( argc == 3 ){
outerlimit = atoi(argv[1]);
innerlimit = atoi(argv[1]);
}
atexit(atexitproc);
for(x=0; !kbhit() && x < outerlimit; ++x){
for(y=1; !kbhit() && y < innerlimit; ++y){
putch('i');
if( (dd = DAPInitialize(SERVERNAME, SERVERTYPE)) == NULL ){
errorexit(0,"Could not initialize DAP");
}
putch('a');
if( (rc = DAPAllocateSession(dd)) != NULL ){
errorexit(rc,"Allocate Session failed");
}
putch('d');
printf("%04ld",*(long *)&(((int *)dd)[1]));
if( (rc = DAPDeAllocateSession(dd)) != NULL ){
errorexit(rc,"De Allocate Request failed");
}
putch('u');
DAPDeInitialize(dd);
printf("\r........\r");
dd = NULL;
++iter;
}
}
printf("%ld total operations performed\n",iter*2);
return 0;
}